<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddNewLogInTimeAndRegisterTimeToUsers extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dateTime("new_login_time")->nullable()->comment("用户最新登陆日期");
            $table->integer("register_time")->index()->nullable()->comment("注册时间，和创建时间区分开，可能系统给追加的，那注册时间就会靠前，比创建时间靠前");
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::table('users', function (Blueprint $table) {
            $table->dropColumn("new_login_time");
            $table->dropColumn("register_time");
        });
    }
}
